using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;

public class ShipUISelecter : MonoBehaviour
{
    public CallbackShipUI m_OnShipUIDroped;
    public InputField m_EditText;
    void Start()
    {
        
    }

    // Update is called once per frame
    void Update()
    {
        
    }
    public void OnDrop(BaseEventData eventDadta)
    {
        if (m_OnShipUIDroped == null)
            return;
        if (!eventDadta.selectedObject || !eventDadta.selectedObject.GetComponent<ShipUIDrager>())
            return;
        var shipUI = eventDadta.selectedObject.GetComponent<ShipUIDrager>().m_ShipUI;
        m_EditText.text = shipUI.uiName;
        m_OnShipUIDroped(shipUI);
    }
}
